{% load comments i18n %}
<form action="" method="post" id="id_comment_form">
   {% csrf_token %}
  {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
  <table>
    <tr>
        <td colspan="2"><input type="hidden" name="email" value="{% if request.user.email %}{{ request.user.email }}{% else %}noreply@invalid.com{% endif %}">
    </tr>
  {% for field in form %}
    {% if field.is_hidden %}
    <tr>
      <td colspan="2">{{ field }}</td>
    </tr>
    {% else %}
      
      {% if field.errors %}<tr><td colspan="2">{{ field.errors }}</td></tr>{% endif %}
        {% if field.name != "email" %}
      <tr
        {% if field.errors %} class="error"{% endif %}
        {% ifequal field.name "url" %} style="display:none;"{% endifequal %}
        {% ifequal field.name "email" %} style="display:none;"{% endifequal %}
        {% ifequal field.name "name" %} style="display:none;"{% endifequal %}
        {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
        <td class="large">
            {{ field.label_tag }}
        </td>
        <td class="right">{{ field }}</td>
      </tr>
        {% endif %}
    {% endif %}
  {% endfor %}
  <tr>
    <td class="large"></td>
    <td class="right"><button dojoType="dijit.form.Button" type="submit" name="submit-comment" value="1">{% trans "Post" %}
        <script type="dojo/method" event="onClicke">
            dojo.xhrPost({
                headers: { 'X-CSRFToken': dojo.cookie("csrftoken") },
                form: "id_comment_form",
                handleAs: "text",
                load: function(data) {
                    dojo.byId("id_comment_form").innerHTML = data;
                }
            });
            return false;
        </script>
    </button></td>
  </tr>
  </table>
  <input type="hidden" name="next" value="{% url ticket_modify ticket.pk %}" />
</form>
